|
![](/i/fill.gif) |
"Thorsten Froehlich" <tho### [at] trf de> wrote:
> You should really profile the code. Then you would find that the matching
> of keywords isn't the bottleneck at all. The simple way of reading from
> file is the real problem. Make the fgetc and ungetc ten times faster and
> you end up with a much faster parser.
In this respect, I can suggest an easy, virtually free (in terms of efforts)
solution: (i) use getc() instead of fgetc(), and (ii) always #include
<stdio.h> in the modules that use getc(). In such a case, you end up using
very efficient macro instead of a function; five to ten times or so as fast;
no side effects. This is an ANSI behaviour, not a VC/GCC/etc. hack.
I am still a bit suspicious as to the real bottlenecks though... but you're
right, there is no point in arguing w/o profiling it. One day I will do this
again, for sure... As you did read my povpro info, you should be aware that
I did that (profiling) in the past, but I have to admit that I did not pay
any attantion to parsing step at the time, at all. Well, one day, when I
have enough time on my hands...
Post a reply to this message
|
![](/i/fill.gif) |